<template>
  <q-dialog class="add-edit-station-dialog dialog" v-model="show" persistent>
    <q-card v-drag>
      <!-- dialog title -->
      <q-card-section class="dialog-title bg-primary">
        <div class="text-center text-white">控制器类型</div>
        <q-btn
          style="font-size: 18px;color: white"
          flat round dense
          class="iconfont icontubiao-67 close-btn dialog"
          @click="hideDialog"
        >
        </q-btn>
      </q-card-section>
      <div style="margin:80px 120px">
        <div v-for="item in controllerType" :key="item.value" class="margin-b-20">
          <q-btn class="btn" :label="item.key" :disable="item.disabled" color="primary" style="width: 140px" @click="typeClick(item.value)"/>
        </div>
      </div>
    </q-card>
  </q-dialog>
</template>

<script>

export default {
  name: 'controller-dialog',
  data () {
    return {
      show: false
    }
  },
  props: {
    controllerType: {
      type: Array,
      default: () => []
    }
  },
  methods: {
    showDialog () {
      this.show = true
    },
    hideDialog () {
      this.show = false
    },
    typeClick (value) {
      this.show = false
      this.$emit('changeType', value)
    }
  }
}
</script>

<style scoped lang="stylus">
</style>
